/*
 Navicat Premium Data Transfer

 Source Server         : local
 Source Server Type    : MySQL
 Source Server Version : 50715
 Source Host           : localhost
 Source Database       : bintreestory

 Target Server Type    : MySQL
 Target Server Version : 50715
 File Encoding         : utf-8

 Date: 09/29/2016 15:36:02 PM
*/

SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;

-- ----------------------------
--  Table structure for `chapter`
-- ----------------------------
DROP TABLE IF EXISTS `chapter`;
CREATE TABLE `chapter` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `story_id` bigint(20) NOT NULL,
  `chapter_id` bigint(20) unsigned DEFAULT NULL,
  `author_id` bigint(20) unsigned NOT NULL,
  `zan_count` int(10) unsigned DEFAULT '0',
  `visit_count` int(10) unsigned DEFAULT NULL,
  `title` varchar(400) DEFAULT NULL,
  `content` text,
  `node_id` bigint(20) unsigned DEFAULT NULL,
  `depth` int(10) unsigned DEFAULT '0',
  `path` text,
  `status` int(10) unsigned DEFAULT NULL,
  `create_time` datetime DEFAULT NULL,
  `update_time` datetime DEFAULT NULL,
  PRIMARY KEY (`id`,`story_id`,`author_id`),
  UNIQUE KEY `chapter_id` (`chapter_id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=38 DEFAULT CHARSET=utf8mb4;

-- ----------------------------
--  Records of `chapter`
-- ----------------------------
BEGIN;
INSERT INTO `chapter` VALUES ('35', '34', '23', '3', '7', null, 'chapter 1 title', 'chapter 1 content', '33', '0', null, '0', '2016-09-29 11:24:33', '2016-09-29 11:24:33'), ('36', '34', '24', '3', '6', null, 'chapter 2 title', 'chapter 2 cotnent', '35', '0', null, '0', '2016-09-29 11:30:47', '2016-09-29 11:30:47'), ('37', '34', '25', '3', '1', null, 'chapter 2 (from 1)', 'content', '34', '0', null, '0', '2016-09-29 12:46:52', '2016-09-29 12:46:52');
COMMIT;

-- ----------------------------
--  Table structure for `node`
-- ----------------------------
DROP TABLE IF EXISTS `node`;
CREATE TABLE `node` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `node_id` bigint(10) unsigned NOT NULL,
  `parent_id` bigint(20) unsigned DEFAULT NULL,
  `author_id` bigint(10) unsigned DEFAULT NULL,
  `story_id` bigint(11) unsigned NOT NULL,
  `content` varchar(255) DEFAULT '',
  `status` int(10) unsigned DEFAULT NULL,
  `create_time` datetime DEFAULT NULL,
  `update_time` datetime DEFAULT NULL,
  PRIMARY KEY (`id`,`story_id`,`node_id`),
  UNIQUE KEY `node_id` (`node_id`)
) ENGINE=InnoDB AUTO_INCREMENT=79 DEFAULT CHARSET=utf8mb4;

-- ----------------------------
--  Records of `node`
-- ----------------------------
BEGIN;
INSERT INTO `node` VALUES ('71', '32', '32', '3', '33', '', '0', '2016-09-29 11:12:55', '2016-09-29 11:12:55'), ('72', '33', '33', '3', '34', '', '0', '2016-09-29 11:19:16', '2016-09-29 11:19:16'), ('73', '34', '33', '3', '34', 'chapter 1 node 1', '0', '2016-09-29 11:24:33', '2016-09-29 11:24:33'), ('74', '35', '33', '3', '34', 'chapter 1 ndoe 2', '0', '2016-09-29 11:24:33', '2016-09-29 11:24:33'), ('75', '36', '35', '3', '34', 'chapter 2 node 1', '0', '2016-09-29 11:30:47', '2016-09-29 11:30:47'), ('76', '37', '35', '3', '34', 'chapter2 node 2', '0', '2016-09-29 11:30:47', '2016-09-29 11:30:47'), ('77', '38', '34', '3', '34', 'chapter 2 node 11', '0', '2016-09-29 12:46:52', '2016-09-29 12:46:52'), ('78', '39', '34', '3', '34', 'chapter 2 node 22', '0', '2016-09-29 12:46:52', '2016-09-29 12:46:52');
COMMIT;

-- ----------------------------
--  Table structure for `story`
-- ----------------------------
DROP TABLE IF EXISTS `story`;
CREATE TABLE `story` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `story_id` bigint(20) unsigned NOT NULL,
  `node_id` bigint(20) unsigned DEFAULT NULL,
  `title` varchar(255) DEFAULT NULL,
  `content` text,
  `author_id` bigint(20) unsigned NOT NULL,
  `status` int(11) DEFAULT NULL,
  `create_time` datetime DEFAULT NULL,
  `update_time` datetime DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `story_id` (`story_id`)
) ENGINE=InnoDB AUTO_INCREMENT=21 DEFAULT CHARSET=utf8mb4;

-- ----------------------------
--  Records of `story`
-- ----------------------------
BEGIN;
INSERT INTO `story` VALUES ('19', '33', '32', 'story 1 title', 'story 1 content', '3', '0', '2016-09-29 11:12:55', '2016-09-29 11:12:55'), ('20', '34', '33', 'story 2 title', 'story 2 content', '3', '0', '2016-09-29 11:19:16', '2016-09-29 11:19:16');
COMMIT;

-- ----------------------------
--  Table structure for `user`
-- ----------------------------
DROP TABLE IF EXISTS `user`;
CREATE TABLE `user` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `user_id` bigint(20) unsigned DEFAULT NULL,
  `password` varchar(255) DEFAULT NULL,
  `email` varchar(255) DEFAULT NULL,
  `user_name` varchar(255) DEFAULT NULL,
  `phone_num` varchar(255) DEFAULT NULL,
  `verify` int(10) unsigned DEFAULT NULL,
  `status` int(10) unsigned DEFAULT NULL,
  `create_time` datetime DEFAULT NULL,
  `update_time` datetime DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `user_id` (`user_id`),
  UNIQUE KEY `email` (`email`)
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8mb4;

-- ----------------------------
--  Records of `user`
-- ----------------------------
BEGIN;
INSERT INTO `user` VALUES ('5', '1', 'b59c67bf196a4758191e42f76670ceba', 'jinyachen@gmail.com', 'jinyachen', '0', null, '0', '2016-09-29 11:06:01', '2016-09-29 11:06:01'), ('6', '2', 'b59c67bf196a4758191e42f76670ceba', 'jinyachen2@gmail.com', 'jinyachen2', '0', null, '0', '2016-09-29 11:09:01', '2016-09-29 11:09:01'), ('7', '3', 'b59c67bf196a4758191e42f76670ceba', 'chenjinya5@163.com', 'chenjinya5', '0', null, '0', '2016-09-29 11:09:23', '2016-09-29 11:09:23'), ('8', '4', 'b59c67bf196a4758191e42f76670ceba', 'chenjinya@163.com', 'chenjinya', '0', null, '0', '2016-09-29 15:27:06', '2016-09-29 15:27:06');
COMMIT;

SET FOREIGN_KEY_CHECKS = 1;
